<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:body>

        <p:dialog widgetVar="telefoneCreateDialog"
                  id="telefoneCreateDialogId" >

            <h:form id="formTelefoneCad">
                <p:messages showSummary="true" globalOnly="true" redisplay="false" />
                <h:panelGrid columns="3">


                    <h:outputLabel for="telefone" value="Telefone: " />
                    <p:inputText id="telefone"
                                 value="#{associadoMB.telefoneMB.telefone.telefone}" size="40" />
                    <p:message for="telefone" />


                    <h:outputLabel for="tipoTelefone" value="Tipo: " />  
                    <p:selectOneMenu id="tipoTelefone" value="#{associadoMB.telefoneMB.telefone.tipoTelefone}" effect="fade" >  
                        <f:selectItems value="#{telefoneMB.tiposTelefone}" var="tipoTelefone" itemLabel="#{tipoTelefone.tipo}" itemValue="#{tipoTelefone}"/>  
                    </p:selectOneMenu> 
                    <p:message for="tipoTelefone" />



                </h:panelGrid>
                <h:panelGrid columns="2">
                    <p:commandButton id="botaoSalvar" type="submit" value="Salvar"
                                     action="#{associadoMB.addTelefone(associadoMB.telefoneMB.telefone)}" ajax="false" />
                    <p:commandButton id="botaoCancelar" type="submit" value="Cancelar"
                                     ajax="false" immediate="true"
                                     action="#{telefoneMB.reset}" />
                </h:panelGrid>


            </h:form>
        </p:dialog>


    </h:body>
</html>